data<-read.table("PARSED_CLINICALDATA",sep="\t",head=T)
library(survival)
mresid <- resid(coxph(Surv(Calc_survivaltime, Calc_survivalEvent) ~ Calc_AGE + Clac_sex, data=data))
data1<-cbind(data,mresid)
colnames(data1)<-c(colnames(data),"residual")
write.table(data1,"PARSED_CLINICALDATA_MARTINGALE",sep="\t",col.names=T,row.names=F)
